﻿<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
	<link rel="Bookmark" href="imgs/bai.ico">
	<link rel="Shortcut Icon" href="imgs/bai.ico"/>
	<title>动物疫病智检系统</title>
	<link href="css/view.css" rel="stylesheet" type="text/css"/>
	<style type="text/css">
		body { width: 100%; height: 100%; background: 0 0 url('../imgs/bg.png') repeat; }
		#form { padding-top: 40px; width: 100%; background: rgba(255, 255, 255, 0.6); text-align: center; color: #555; }
		.title { padding: 50px; color: #000; font-weight: bolder; font-size: 25px; }
		input { margin-bottom: 20px; padding: 10px; width: 60%; border: 1px solid rgb(27, 207, 106); border-radius: 5px; }
		input[type=button] { border: none; background: rgb(27,207,106); color: #fff; cursor: pointer; }
		input[type=button]:hover { color: #eee; }
	</style>
</head>
<body>
	<!--顶部-->
	<div id="header"></div>

	<!--登录-->
	<div id="form">
		<div class="middle">
			<div class="title">账号登录</div>
			<input type="text" id="uname" placeholder="输入账号" value="test"/>
			<input type="password" id="passwd" placeholder="输入密码" value="111111"/>
			<input type="button" value="即 可 登 录" onclick="dologin();"/>
		</div>
	</div>

	<!--弹窗-->
	<span id="msgPop"></span>
</body>
</html>


<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/view.js"></script>
<script type="text/javascript">
	var cw = document.documentElement.clientWidth;
	var ch = document.documentElement.clientHeight;
	(function(){
		$('#form').height(ch - 100);
	})();
	var testData = {
		uname: 'test', upwd: '111111',
	};
	function dologin(){
		var formData = {
			uname: $('#uname').val(),
			passwd: $('#passwd').val(),
		};
		if (formData.uname == '') {
			msgPop({msg: '账号必须的'}); return
		}
		if (formData.passwd == '') {
			msgPop({msg: '密码必须的'}); return
		}
		if (formData.uname != testData.uname) {
			msgPop({msg: '账号不存在'}); return
		}
		if (formData.passwd != testData.upwd) {
			msgPop({msg: '密码错误'}); return
		}
		var adminInfo = {
			uname: formData.uname,
		};
		setAdminInfo({val: adminInfo});
		msgPop({msg: '登录成功'});
		setTimeout(function(){
			window.location.href = 'index.html';
		}, 500);
	}
</script>